package com.itxx.allTools.homeWork.demo;

public class Phone {
    /*请按标准格式定义一个“手机类”，它有三个属性：品牌(String)、颜色(String)、价格(double)
    请编写测试类，创建两个“手机对象”并为它们的属性赋值，并能直接打印手机对象的属性信息。*/
    private String brand;
    private  String color;
    private  double price;

    @Override
    public String toString() {
        return "Phone{" +
                "brand='" + brand + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                '}';
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Phone(String brand, String color, double price) {
        this.brand = brand;
        this.color = color;
        this.price = price;
    }

    public Phone() {
    }
}
class Test{
    public static void main(String[] args) {
        Phone p1 = new Phone("苹果","白色",3666.0);
        Phone p2 = new Phone("小米","蓝色",2999.0);
        Phone p3 = new Phone("华为","黑色",3100.0);
        System.out.println(p1);
        System.out.println(p2);
        System.out.println(p3);
    }
}
